package util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HttpFactory {
    //线程安全锁定
    public static final ThreadLocal<HttpFactory> actionFactory=new ThreadLocal<HttpFactory>();

    private HttpServletResponse response;
    private HttpServletRequest request;

    public HttpServletResponse getResponse() {
        return response;
    }

    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }

    public HttpServletRequest getRequest() {
        return request;
    }

    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    private HttpFactory(){

    }
    public static HttpFactory getActionFaction(){
        if(actionFactory.get()==null){
            HttpFactory httpFactory = new HttpFactory();
            actionFactory.set(httpFactory);
        }
        return actionFactory.get();
    }
}
